import { Children, useState } from "react"

function Did (props){
    console.log(props);
    let { children} =props
    console.log(typeof children);
    let res =null;
    if(typeof children === "function"){
        res=children();
    }else{
        res=children
    }
    return (<> {res} </>)
}
// 函数式组件
function DemoB(props){
    return( 
        <>
            <Did><div>hello react</div></Did>
            <Did>{() =>{ return (<div>你好</div>)}}</Did>
            <Did>你好</Did>
            <Did>{true}</Did>

        </>
    )
}
export default DemoB